/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package motorprediccion;

import com.bbn.openmap.LatLonPoint;

/**
 *
 * @author dani
 */
public class Parada {
    private Integer idParada, orden;
    private Double latitud, longitud;

    public Parada(Integer idParada, Integer orden, Double latitud, Double longitud) {
        this.idParada = idParada;
        this.orden = orden;
        this.latitud = latitud;
        this.longitud = longitud;
    }

    public Integer getId() {
        return idParada;
    }

    public LatLonPoint getPosicion() {
        return new LatLonPoint(this.latitud, this.longitud);
    }

    Double calcularDistancia(LatLonPoint fin) {
        return new Double(com.bbn.openmap.proj.Length.METER.fromRadians((new LatLonPoint(this.latitud, this.longitud)).distance(fin)));
    }
    
    Double calcularDistancia(Float latitud, Float longitud) {
        return new Double(com.bbn.openmap.proj.Length.METER.fromRadians((new LatLonPoint(this.latitud, this.longitud)).distance(new LatLonPoint(latitud, longitud))));
    }
    
    public Integer getOrden() {
        return orden;
    }
}
